<!DOCTYPE html>
<html ng-app="myApp">
<head>
    <meta charset="utf-8"/>
    <title>51问医生</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    {{--<link rel="shortcut icon" href="/Public/mobile/favicon.ico" type="image/x-icon" />--}}
    <meta name="format-detection" content="telephone=no"> <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="yes"/>
    <script src="{{url('/js/jquery.min.js')}}" type="text/javascript"></script>

    <!-- Noty 提示框的js集成 -->
    <script src="{{ url('vendor/noty-2.2.9/packaged/jquery.noty.packaged.js') }}"></script>
    <script src="{{ url('vendor/noty-2.2.9/themes/bootstrap.js') }}"></script>
    <script src="{{ url('vendor/noty-2.2.9/options.js') }}"></script>

    <link rel="stylesheet" href="{{url('new/css/common.css')}}" />
    <link rel="stylesheet" href="{{url('new/css/doctor_detail.css')}}" />
    <script src="{{url('new/js/doctor_list.js')}}"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
</head>
<body ng-controller="MainCtrl" class="clearUl">
{{--<div class="app-content" ui-view> </div>--}}
<div ng-if="doctor.msg" class="docInfo_wrapper">
    <div class="icon-cover">
        {{--<img class='doctor-icon' src="http://mcdn.anxinyisheng.com/Public/mobile/img/common/head_icon_7303b1f.png" />--}}
        <img class='doctor-icon' src="@if($doctor){{route('Api.Image.Show',['id'=>$doctor->doc_img])}}@else{{route('Api.Image.Show',['id'=>0])}}@endif" />
    </div>
    <div class="doc-info">
        <p class="name">
            <span>@if($doctor){{$doctor->doc_name}}@endif</span>
        </p>
        <p class="hospital">@if($doctor){{$doctor->subject}}，{{$doctor->station}}@endif</p>
        <p class="hospital">@if($hospital){{$hospital->name}}@endif</p>
    </div>
    <a class="reward" id="follow">
        @if($follow)取消关注@else关注医生@endif
    </a>
    <div class="skill">
        <div class="p-text">
            <span class="skill-title">医生简介</span>
            {{--<span id="skill">doctor.msg.skilled_field</span>--}}
            <span id="skill">@if($doctor){{$doctor->introduction}}@endif</span>
            <span id="skill"></span>
        </div>
        <div class="p-svg">
            {{--<svg class="down-icon">--}}
                {{--<use xlink:href="#arrow_solid_down"></use>--}}
            {{--</svg>--}}
        </div>
    </div>
</div>
{{--<div class="elizaBroadcast" ng-if="doctor.msg.isQueenSchedule" ng-click="goAppt(doctor.msg.audit_status,'OnVipAppoint')">--}}
{{--<svg >--}}
{{--<use xlink:href="#board"></use>--}}
{{--</svg>--}}
{{--<span class="rollBox">--}}
{{--<span text-roll style="width:10px;">--}}
{{--<span class="text" style="width:10px">elizaScheduleText</span>--}}
{{--<span class="text" style="width:10px">elizaScheduleText</span>--}}
{{--</span>--}}
{{--</span>--}}
{{--</div>--}}
<div ng-if="doctor.msg" class="doctor-indexs">
    <div class="doc_fn_all ax-boxshadow">
        <a class="btn " id="online" href="{{route('M.Home.askDoctor',['id'=>$doctor->user_id])}}">
            <span class="btn-icon chat-icon"></span>
            <div class="btn-content">
                <span class="btn-title">提问医生</span>
                <span class="btn-desc">可在线提问医生</span>
            </div>
            <svg class="doc-apptlite-arrow">
                <use xlink:href="#arrow_right"></use>
            </svg>
        </a>
        <!-- <a class="btn " ng-class="{'disable':!doctor.msg.isOnCall}" href="javascript:;" ng-click="goAppt(doctor.msg.audit_status,'OnCall')">
        <span class="btn-icon call-icon"></span>
        <div class="btn-content">
        <span class="btn-title" >电话咨询</span>
        <span class="btn-desc" >电话沟通，高效直接</span>
        </div>
        <svg class="doc-apptlite-arrow">
        <use xlink:href="#arrow_right"></use></svg> </a> -->
        <a class="btn marginBotm" href="{{route('M.Home.newAppoint')}}?doc_id={{$doctor->user_id}}">
            <span class="btn-icon qa-icon"></span>
            <div class="btn-content">
                <span class="btn-title">预约医生
                    <span class="discount-icon">热门</span>
                </span>
                <span class="btn-desc" >立刻预约，便捷就医</span>
            </div>
            <svg class="doc-apptlite-arrow">
            </svg>
        </a>
        <a class="btn " href="{{route('M.Home.newMianzhen')}}?doc_id={{$doctor->user_id}}">
            <span class="btn-icon vip-icon"></span>
            <div class="btn-content">
                <span class="btn-title" >专家面诊 <!-- <span ng-if="!doctor.msg.isEliza && discountVip && !discountVipFree" class="discount-icon">立减discountVipPrice</span> -->
                    {{--<span ng-if="doctor.msg.isEliza && doctor.msg.isQueenSchedule && !doctor.msg.appointFee" class="discount-icon">热门</span>--}}
                    <!-- <span ng-if="discountVip && discountVipFree" class="discount-icon">免费</span>--> <!-- <span ng-if="discountVip " class="discount-icon">免费</span> -->
                </span>
                <span class="btn-desc" >不排队，专属时间看诊</span>
            </div>
            <svg class="doc-apptlite-arrow">
            </svg>
        </a>
    </div>
    <div class="p-list" ng-if="doctor.msg.notice &&  doctor.msg.notice.ison === '1'  && doctor.msg.notice.notice" ng-class="{'txtClose': !isnoticeShow,'isTextOverflow':isnoticeOverflow,'isSpice':isnoticeellispise}">
        <div class="p-list-head" style="padding-bottom: 0.15rem;">
            <span >医生公告</span>
        </div>
        <div class="p-text">
            <span id="notice">@if($doctor){{$doctor->notice}}@endif</span>
            {{--<span ng-if='!doctor.msg.notice.notice'>暂未添加</span>--}}
        </div>
        <div class="p-svg" ng-if="isnoticeOverflow">
            <svg class="down-icon"><use xlink:href="#arrow_solid_down"></use></svg>
        </div>
    </div>
</div>
<!--加载qalist问题列表-->
<div >
    <div class="listNum">
        <p>Ta回答过的问题
            {{--<span ng-if="isDuringQafree" class="discount-icon discount-icon-rem">春节免费看</span>--}}
        </p>
    </div>
    <ul>
    @if(count($questions)>0)
        @foreach($questions as $question)
        <li class="qaList-one">
            <div class="question">
                <span class="lable">问题：</span>
                {{$question->question}}
            </div>
            <div class="doc-card-qalist">
                {{--<p>@if($question->doctor){{$question->doctor->doc_name}}-{{$question->doctor->station}}，{{$question->doctor->hospital}} @endif</p>--}}
                <div class="info">
                    <div class="icon-cover">
                        <img class='doctor-icon' src="@if($doctor){{route('Api.Image.Show',['id'=>$doctor->doc_img])}}@else{{route('Api.Image.Show',['id'=>0])}}@endif">
                        <span></span>
                    </div>
                    <div class="ax-bubble">
                        <a href="{{route('M.Home.newShowAnswer')}}?q_id={{$question->id}}" style="color:white;">
                            <timefree ng-if="!o.iftimefree">查看回答</timefree>
                        </a>
                    </div>
                    <p class="num">
                        <span class="viewed">{{$question->read_num}}&nbsp;看过 </span>
                    </p>
                </div>
            </div>
        </li>
            @endforeach
        @endif
    </ul>
    {{--<div ng-if="isShowMoreLoading&&qaList.length" class="noData">--}}
        {{--<p>正在加载</p>--}}
    {{--</div>--}}
</div>
<script>
    $(function(){
        var url=location.href;
        $.ajax({
            type : "post",
            url : "{{url('api/wechat/get-js-api-packet')}}",//替换网址，xxx根据自己jssdk文件位置修改
            dataType : "json",
            data:{url:url},
            success : function(obj){
                if(obj.level == 'success'){
                    var data = obj.data;
                    wx.config({
                        appId: data.appId,
                        timestamp: data.timestamp,
                        nonceStr: data.nonceStr,
                        signature: data.signature,
                        jsApiList: [
                            "onMenuShareTimeline", //分享给好友
                            "onMenuShareAppMessage", //分享到朋友圈
                            "onMenuShareQQ", //分享到QQ
                            "onMenuShareWeibo", //分享到微博
                            'chooseImage', 'previewImage', 'uploadImage', 'downloadImage'
                        ]
                    });
                }
            },
            error:function(data){
                alert("连接失败！");
            }
        });

        var imgUrl = "@if($doctor){{route('Api.Image.ShowPX',['id'=>$doctor->doc_img,'px'=>'100px'])}}@else{{url('images/logo.jpg')}}@endif";
        var lineLink = "{{route('M.Home.newDoctorDetail',['id'=>$doctor->id])}}";
        var descContent = '{{$doctor->introduction}}';
        var shareTitle = '{{$doctor->doc_name}}医生';

        wx.ready(function (){
            var shareData = {
                title: shareTitle,
                desc: descContent,//这里请特别注意是要去除html
                link: lineLink,
                imgUrl: imgUrl
            };
            wx.onMenuShareAppMessage(shareData);
            wx.onMenuShareTimeline(shareData);
            wx.onMenuShareQQ(shareData);
            wx.onMenuShareWeibo(shareData);
        });


        $(document).on('click','#follow',function(){
            $.ajax({
                url:'{{route('Api.User.followDoctor')}}',
                type: 'post',
                dataType:'json',
                data:{doc_id:'{{$doctor->user_id}}'},
                success:function(obj){
                    if(obj.level == 'success'){
                        if(obj.data == 'cancel'){
                            $('#follow').html('关注医生');
                        }else{
                            $('#follow').html('取消关注');
                        }
                    }
                },
                error:function(obj){
                    var dataJson = obj.responseJSON;
                    noty({type:dataJson.level,text:dataJson.message,timeout:600});
                }
            });
        });
    });
</script>
</body>
</html>



